package com.buba.commodity.controller;

import com.buba.commodity.pojo.ProductImage;
import com.buba.commodity.service.ProductImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/ProductImage")
public class ProductImageController {
    private ProductImageService productImageService;

    @RequestMapping("/selProductImage")
    public Map<String, Object> selProductImage(){
        Map<String,Object> map = new HashMap<>();
        List<ProductImage> img = productImageService.selProductImage();
        map.put("img",img);
        return map;
    }


    @Autowired
    @Qualifier("productImageServiceImpl")
    public void setProductImageService(ProductImageService productImageService) {
        this.productImageService = productImageService;
    }
}
